﻿
@{
    ViewBag.Title = "BudgetNotificationAdd";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="SafetyCultureController" ng-init="
     page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     pagename='@(Request.QueryString["pagename"].IsEmpty() ? "" : Request.QueryString["pagename"])';
     AddModel.ReportTime = '@DateTime.Now.AddDays(1).ToString("yyyy-MM-dd")';
     AddModel.FormNo = '@ViewBag.FormNo';
     AddModel.Type=1;
    ">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />

			</path>
		</svg>
            <div class="load-msg">正在加载...</div>
        </div>
    </div>
    <div class="page-heading">
        <h1>添加安全奖励</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>安全文化</a></li>
        <li><a>安全奖励</a></li>
        <li class="active"><a>新增安全奖励</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-md-12">
                    <div class="panel panel-sky">
                        <div class="panel-heading"><h2>新增安全奖励</h2></div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>标题：</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" placeholder="标题" ng-model="AddModel.Title" />
                                </div>
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>编号：</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" placeholder="编号" ng-model="AddModel.FormNo" readonly />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>填报人：</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" placeholder="标题" ng-model="User.UserName" readonly />
                                </div>
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>填报时间：</label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control" placeholder="填报时间" ng-model="AddModel.ReportTime" readonly />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>通知内容：</label>
                                <div class="col-sm-9">
                                    <textarea name="ckeditor" id="casecontent" cols="80" rows="20" class="ckeditor"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>导入名单：</label>
                                <div class="col-sm-2">
                                    <input type="file" class="form-control" accept=".xls,.xlsx" id="employeelistfile" />
                                </div>
                                <div class="col-sm-1">
                                    <button class="btn-primary btn" ng-click="ImportEmployeeList(AddModel.FormNo);">导入</button>
                                </div>
                                <div class="col-sm-1">
                                    <a href="#">下载导入模板</a>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>奖励人员：</label>
                                <div class="col-sm-11">

                                    <table class="table table-bordered">
                                        <thead>
                                            <tr>
                                                <th>序号</th>
                                                <th>所属部门</th>
                                                <th>工号</th>
                                                <th>姓名</th>
                                                <th>奖励事由</th>
                                                <th>奖励内容</th>
                                                <th>奖金</th>
                                                <th>奖励日期</th>
                                                <th>操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ng-show="ItemList==null || ItemList.length==0">
                                                <td colspan="8">暂未导入数据</td>
                                            </tr>
                                            <tr ng-repeat="x in ItemList">
                                                <td>{{$index+1}}</td>
                                                <td><input type="text" class="form-control" ng-model="x.DepartmentName" /></td>
                                                <td><input type="text" class="form-control" ng-model="x.EmployeeNo" /></td>
                                                <td><input type="text" class="form-control" ng-model="x.EmployeeName" /></td>
                                                <td><input type="text" class="form-control" ng-model="x.Reason" /></td>
                                                <td><input type="text" class="form-control" ng-model="x.Content" /></td>
                                                <td><input type="number" class="form-control" ng-model="x.Amount" /></td>
                                                <td><input type="text" class="form-control" ng-model="x.DataTime" /></td>
                                                <td>
                                                    <button class="btn btn-xs btn-danger btn-label" ng-click="RemoveRapItems(x,ItemList)"><i class="fa fa-trash-o"></i>移除</button>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>奖励人数：</label>
                                <div class="col-sm-2">
                                    <input type="text" class="form-control" value="{{ItemList.length}}" readonly />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>备注：</label>
                                <div class="col-sm-9">
                                    <textarea type="text" class="form-control" ng-model="AddModel.Remark" rows="5"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">上传附件<span class="not-null"></span></label>
                                <div class="col-lg-9" style="margin-top:5px;">
                                    <input type="file" ngf-select ng-model="doc.Files" name="docfiles" id="docfiles" class="file" initialPreviewAsData="true" data-show-remove="true" data-show-preview="true" showCancel="false" data-show-upload="false" multiple required>
                                </div>

                            </div>
                        </div>
                        <div class="panel-footer">
                            <div class="col-md-4">
                            </div>
                            <div class="col-md-1">
                                <button class="btn-primary btn" ng-click="AddSafetyRapForm(AddModel,ItemList,pagename);">提交</button>
                            </div>
                            <div class="col-md-1">
                                <a href="SafetyCasePageList?page={{page}}" class="btn-default btn">返回</a>
                            </div>
                            <div class="col-md-3">
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>

    </div>

</div>

@section Js{
    <script src="~/Assets/plugins/form-ckeditor/ckeditor.js"></script>
    <script src="~/Assets/js/libs/upload.js"></script>
    <script src="~/Assets/js/pg/SafetyCulture.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/Assets/js/libs/moment.min.js"></script>
    <script src="~/Assets/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/Assets/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/Assets/js/libs/angularjs-datepicker.js"></script>
    <script src="~/Assets/js/libs/fileinput.js"></script>
    <script src="~/Assets/js/libs/zh.js"></script>
    <script>
        $('#SelectedCheckList').sortable({
            connectWith: ".sortable-connected",
            receive: function (event, ui) {
                var lists = $('.sortable-connected');
                for (var i = lists.length - 1; i >= 0; i--) {
                    if ($(lists[i]).children().length < 1) $(lists[i]).html('');
                };
            }
        });
        $('#docfiles').fileinput({
            language: 'zh'
        });
    </script>
}
